import request from '@/utils/request'
let org_code = localStorage.getItem('org_code')
// h获取任务统计
export function getTaskStatistic (params) {
	return request({
		url: '/Tasks/management',
		method: 'get',
		params
	})
}

// 新增任务
export function creaTask (params) {
	return request({
		url: 'Tasks',
		method: 'get',
		params
	})
}

// 删除任务
export function deleteTask (params) {
	return request({
		url: 'Tasks',
		method: 'delete',
		params
	})
}

// 更新
export function updateTask (params) {
	return request({
		url: `Tasks/{params.id}`,
		method: 'put',
		params
	})
}

// 任务重置
export function taskRetry (data) {
	return request({
		url: '/Tasks/restart',
		method: 'patch',
		data: data
	})
}

// 优先采集
export function taskPriority (data) {
	return request({
		url: '/Tasks/priority',
		method: 'patch',
		data: data
	})
}

// 优先采集
export function getTaskStatic (data) {
	return request({
		url: `Tasks/statistic/${org_code}`,
		method: 'get'
	})
}
